package com.kuaimacode.kframework.admin.services.master;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.kuaimacode.kframework.admin.vo.request.MasterDrawApplyReq;
import com.kuaimacode.kframework.admin.vo.request.MasterReq;
import com.kuaimacode.kframework.mybatis.mapper.user.UserDrawApplyMapper;
import com.kuaimacode.kframework.mybatis.models.user.MasterAccountResult;
import com.kuaimacode.kframework.mybatis.models.user.UserAccountDetail;
import com.kuaimacode.kframework.mybatis.models.user.UserDrawApply;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 12786 on 2019/5/25.
 * @version 1.0
 */
@Service
public class MasterDrawApplyService extends ServiceImpl<UserDrawApplyMapper, UserDrawApply> {

    /**
     * 查询师傅余额信息
     * @param masterReq
     * @param pageNum
     * @param pageSize
     * @return
     */
    public PageInfo<MasterAccountResult> getMasterAccount(MasterReq masterReq,int pageNum,int pageSize){
        PageHelper.startPage(pageNum,pageSize);
        return new PageInfo<>(baseMapper.selectMasterAccount(masterReq.getMasterName()));
    }


    public PageInfo<MasterAccountResult> getMasterDrawApply(MasterDrawApplyReq drawApplyReq, int pageNum, int pageSize){
        PageHelper.startPage(pageNum,pageSize);
        return new PageInfo<>(baseMapper.getMasterDrawApply(drawApplyReq.getMasterName(),drawApplyReq.getApplyStatus()));
    }
}
